# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: BlackEagle < ike DOT devolder AT gmail DOT com >
# Contributor: Preecha Patumchareonpol <yumyai at gmail.com> 

pkgname=podofo
pkgver=0.9.8
pkgrel=5
pkgdesc="A C++ library to work with the PDF file format"
arch=('loong64' 'x86_64')
url="http://podofo.sourceforge.net"
license=('GPL')
depends=('lua' 'openssl' 'fontconfig' 'libtiff' 'libidn' 'libjpeg-turbo')
makedepends=('cmake')
source=("https://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz")
md5sums=('f6d3d5f917c7150c44fc6a15848442dd')
sha256sums=('5de607e15f192b8ad90738300759d88dea0f5ccdce3bf00048a0c932bc645154')

build() {
  cd ${pkgname}-${pkgver}

  mkdir -p "test/TokenizerTest/objects"

  mkdir build
  cd build
  cmake -DCMAKE_INSTALL_PREFIX=/usr .. \
        -DFREETYPE_INCLUDE_DIR=/usr/include/freetype2 \
        -DPODOFO_BUILD_SHARED=1 \
        -DPODOFO_HAVE_JPEG_LIB=1 \
        -DPODOFO_HAVE_PNG_LIB=1 \
        -DPODOFO_HAVE_TIFF_LIB=1
  make
}

package() {
  cd ${pkgname}-${pkgver}/build
  make DESTDIR="${pkgdir}" install
}
